<?php


/**
 * Description of ChartsController
 *
 * @author Francis Adu-Gyamfi <francis.adu-gyamfi@matrixdesigns.org>
 */
class ChartsController extends AppController {
    //put your code here
    
    public $uses = array('OrganisationMember');
    public $components = array('Api');
    
    public function member_stats($status = 'member') {
        $this->autoRender = false;
        
        $orgAccount = $this->Session->read('org_account');
        
        $results = $this->Api->post('/organisation/member_stats', array(
            'organisation_id' => $orgAccount['Organisation']['id'],
            'stats_type' => 'charts',
            'chart_types' => array('recent_members', 'recent_visitors')
        ));
        
        return json_encode($results);
    }
}
